using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using DecisionMaking.Domain;

namespace DecisionMaking.BusinessLogic.Model
{
    public class CandidateModel
    {
        public CandidateModel()
        {
            CueValues = new List<CandidateCueValueModel>();
        }

        public int? CandidateId { get; set; }

        public int? EnvironmentId { get; set; }

        [Required]
        [DisplayName("Name")]
        [DataType(DataType.Text)]
        [StringLength(50)]	
        public string Name { get; set; }

        [Required]
        public double? IndependentVariableValue { get; set; }

        public IList<CandidateCueValueModel> CueValues { get; set; }

        /// <summary>
        /// Initializes the CueValues for this model
        /// </summary>
        /// <param name="cues"></param>
        public void InitCues(IEnumerable<Cue> cues)
        {
            foreach(var a in cues)
            {
                CueValues.Add(new CandidateCueValueModel{CueId = a.Id, Name = a.Name});
            }
        }
	
    }


    public class CandidateCueValueModel
    {
        public int CueId { get; set; }
        public string Name { get; set; }
        public double? Value { get; set; }
    }
}